package Test;

/**
 * @ClassName Main5
 * @Description
 * @Company inspur
 * @Author Kevin
 * @Date 2020/8/2 20:04
 * @Version 1.0
 */
import java.util.*;


public class Main5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int T = sc.nextInt();
        int[][] zao = new int[N][2];
        int[][] wan = new int[M][2];

        boolean flag = false;

        //如果美味=0
        if(T == 0) {
            System.out.print(0);
            return;
        }
        int tempMin = 200000;
        for(int i = 0; i < N; i++) {
            zao[i][0] = sc.nextInt();
            zao[i][1] = sc.nextInt();
            if(zao[i][1] >= T) {
                //System.out.print(zao[i][0]);
                //return;
                if (zao[i][0] < tempMin) {
                    tempMin = zao[i][0];
                    flag = true;
                }

            }
        }
        for(int i = 0; i < M; i++) {
            wan[i][0] = sc.nextInt();
            wan[i][1] = sc.nextInt();
            if(wan[i][1] >= T) {
//                System.out.print(wan[i][0]);
//                return;
                if (wan[i][0] < tempMin) {
                    flag = true;
                    tempMin = wan[i][0];
                }
            }
        }
//        if (tempMin != 20001) {
//            System.out.print(tempMin);
//            return;
//        }

        //三情况： 只吃早、只吃晚、早晚都吃
        //早晚都吃

        int min = 200000;
        int temp;
        for(int i = 0; i < N; i++) {
            for(int j = 0; j < M; j++) {
                //超时改动：跳过一些
                if (zao[i][0] >= tempMin || wan[j][0] >= tempMin) {
                    continue;
                }

                //美味和
                temp = zao[i][1] + wan[j][1];
                if(temp >= T) {
                    flag = true;
                    //热量和
                    int s = zao[i][0] + wan[j][0];
                    if(s < min) {
                        min = s;
                    }
                }
            }
        }

        min = Math.min(tempMin, min);

        if(flag == false) {
            System.out.print(-1);
        } else {
            System.out.print(min);
        }
    }
}